import QMFetch from 'api/index';
import Api from '../webapi.js'
class WebApi  extends Api{

   
    /**
     * 查询文章列表
     */
    fetchArticles = (posts) => QMFetch({
                url: 'article/list',
                method: 'POST',
                body: posts
            }
        )

    fetchArticleDetail = (id) => QMFetch({
                url:`article/${id}`,
                method: 'GET',
            }
        )
    /**
     * 删除文章
     * @param id 文章编号
     */
    deleteArticle = (id) => {
        return QMFetch({
            url: `article/del/${id}`,
            method:"POST",
            body:{}
        })
    }
}

export default new WebApi();